< previous page page_19 next page >

Page 19
This concept seems simple in theory, but it's not so easy in practice. The CustomerName field discussed earlier is a good example. Assume that you have a database that contains a list of your customers by name, and you need to sort the list by last name. How would this be done? Can you assume that each CustomerName data field contains a last name? Do some contain only a first name? Possibly some contain both first and last namesbut in what order (last name, first name or first name, last name)? When you look at this situation, you discover that you're actually storing two data elements in the CustomerName field (first name and last name). For this reason, many databases contain not just the CustomerName data field, but data fields for LastName and FirstName.
When you begin constructing your database, spend time thinking about the various ways you (and your users) need to retrieve useful data. The quality and usefulness of your database rests on the integrity of its smallest elementthe data field.
Data Records
Data records are a collection of related data fields. To use the example started earlier, a Customer Record could contain the fields LastName, FirstName, and AccountBalance. All three fields describe a single customer in the database.
Note.gif
Formal database theory refers to a data record as a data row. Both data record and data row are used interchangeably throughout this book.

A single data record contains only one copy of each defined data field. For example, a single data record cannot contain more than one LastName data field. Figure 2.2 shows the Company Database with a Customer Record defined. The Customer Record (row) contains three fields (columns).
0019-01.jpg
Figure 2.2.
An example of a data record in a database.

 
< previous page page_19 next page >

If you like this book, buy it!